package com.syni.mdd.yhd.common.all.controller.pay.aliPay;

import com.syni.mdd.sjb.common.component.utils.common.utils.ResultMapHelper;
import com.syni.mdd.yhd.common.all.config.pay.alipay.AlipayConfigRun;
import com.syni.mdd.yhd.common.all.service.pay.aiPay.AliPayService;
import com.syni.mdd.yhd.common.all.utils.OrderUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @className AliPayTestController
 * @description TOO
 * @Author cfx
 * @DATE 2020/4/4 11:44
 * @VERSION 1.0
 **/
@RestController
@RequestMapping("aliPay/test/")
@Profile({"dev","local","preo"})
@Log4j2
public class AliPayTestController {

    @Autowired
    AliPayService aliPayService;
    /**
     * 支付结果回调
     */
    @GetMapping("/paySucess")
    public Map<String,Object> paySucess(Integer orderId, @RequestParam(value = "payWay",required = false) Integer payWay) {
        aliPayService.test(orderId,payWay);
        return ResultMapHelper.success(null,"ok");
    }
}
